import logging

import requests
from requests import Response

from common.log import logger


class RequestsBase:
    # 唯一的类变量
    sess = requests.session()

    # 统一的发送请求接口
    def request(self, **kwargs) -> Response:
        res = RequestsBase().sess.request(**kwargs)
        logger.debug(f"url:{kwargs['url']} status_code:{ res.status_code}" )
        return res
